/* Teach Tool  - Structural Dynamics
 * Copyright (C) 2009: Fabian Gerold, www.fabiangerold.de
 *
 * This file may be licensed under the terms of of the
 * GNU General Public License Version 3 (the "GPL").
 * 
 * Software distributed under the License is distributed 
 * on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
 * express or implied. See the GPL for the specific language 
 * governing rights and limitations.
 *
 * You should have received a copy of the GPL along with this 
 * program. If not, go to http://www.gnu.org/licenses/gpl.html
 * or write to the Free Software Foundation, Inc., 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef WindowHarm_h
#define WindowHarm_h

#include <QtGui>

class SystemHarm;
class Diagram;
class DiagramScroll;
class EMSWidget;

class WindowHarm : public QWidget
{
    Q_OBJECT

public:
    WindowHarm( SystemHarm* sys );

	void updateTime( double sec );
	void appendOutput( const QString& text );
	void clearOutput();

public slots:
	void slotUpdateParameter( double, double, double, double );
	void slotDiagPlusScale();
	void slotDiagMinusScale();

private slots:
	void slotStart();
	void slotToggleHalt();
	void slotResetSystem();
	void slotSpringChanged( int slider_pos );
	void slotSpringChanged();
	void slotMassChanged( int slider_pos );
	void slotMassChanged();
	void slotDampChanged( int slider_pos );
	void slotDampChanged();
	
	void slotModeChanged( int mode );
	void slotOmegaFChanged();
	void slotF0Changed();
	void slotOmegaGChanged();
	void slotG0Changed();
	
	void slotCheckUChanged();
	void slotTxtOutRadio();
	void slotClipboard();
	void slotShowAbout( bool checked );
	
private:
	QWidget* createAboutWidget();
	QWidget* createGroundExWidget();
	QWidget* createForceExWidget();
	QWidget* createSimWidget();
	QWidget* createControlWidget();
	QWidget* createParamsWidget();
	QWidget* createTxtOutWidget();
	
	QStackedWidget* m_stack;
	SystemHarm*		m_system;
    QLabel*			m_time_label;
	QLabel*			m_label_hint;
	Diagram*		m_diag;
	QLabel*			m_label_diag_scale;
	
	QPushButton*	m_btn_start;
	QPushButton*	m_btn_halt;
	QPushButton*	m_btn_reset;
	
	QLineEdit*		m_le_omegaF;
	QLineEdit*		m_le_F0;
	QLineEdit*		m_le_omegaG;
	QLineEdit*		m_le_G0;

	EMSWidget*		m_ems;

	QCheckBox*		m_check_u;
	QCheckBox*		m_check_up;
	QCheckBox*		m_check_upp;

	QSlider*		m_slide_spring;
	QLineEdit*		m_le_spring;
	QSlider*		m_slide_mass;
	QLineEdit*		m_le_mass;
	QSlider*		m_slide_damp;
	QLineEdit*		m_le_damp;

	QLabel*			m_T_label;
	QLabel*			m_f_label;
	QLabel*			m_omega_label;
	QLabel*			m_omega_d_label;

	DiagramScroll*	m_diagscroll;
	QTextEdit*		m_textedit;
	QRadioButton*	m_radio_notext;
	QRadioButton*	m_radio_slowtext;
	QRadioButton*	m_radio_fasttext;
	QPushButton*	m_btn_clipboard;
	QLabel*			m_inf_label;
	
};

#endif
